<html>
<head>
    <title>Title</title>
	<script type="text/javascript" src="jquery.min.js"></script>
	<script type="text/javascript" src="jquery.cookie.js"></script>
</head>
<body>
<span id="email"></span>
    
</body>
<script>

$(function () {
	info();
})
function info(){
	
	var token = getCookie("token");

	$.ajax({
		url: 'http://localhost/api/user/info/'+token,
		type: 'get',
		contentType: 'application/json;charset=utf-8',
		dataType: 'json',
		success: function (data) {

			$("#email").html(data.data+",欢迎登录系统");
			
		}
	})
}

function getCookie(name){
    var strcookie = document.cookie;//获取cookie字符串
    var arrcookie = strcookie.split("; ");//分割
    //遍历匹配
    for ( var i = 0; i < arrcookie.length; i++) {
        var arr = arrcookie[i].split("=");
        if (arr[0] == name){
            return arr[1];
        }
    }
    return "";
}
</script>
</html>